/*
import com.alicloud.openservices.tablestore.SyncClient;
import com.alicloud.openservices.tablestore.model.*;

public class OTSTest {

    final static String endPoint = "http://10.151.235.112";
    final static String accessKeyId = "JEYGTdPZP4m6eZvD";
    final static String accessKeySecret = "fnBcOKYWnCm790o5xzhTjyrgK8vaVu";
    final static String instanceName = "szidc";

    public static String getRow(){
        // 构造主键
        SyncClient client = new SyncClient(endPoint, accessKeyId,
                accessKeySecret, instanceName);
        Long startTime = System.currentTimeMillis();
        PrimaryKeyBuilder primaryKeyBuilder = PrimaryKeyBuilder.
                createPrimaryKeyBuilder();
        primaryKeyBuilder.addPrimaryKeyColumn("ddatetime",
                PrimaryKeyValue.fromString("1997-01-02 00:00:00"));
        primaryKeyBuilder.addPrimaryKeyColumn("obtid",
                PrimaryKeyValue.fromString("G1150"));
        PrimaryKey primaryKey = primaryKeyBuilder.build();
        // 读一行
        SingleRowQueryCriteria criteria = new SingleRowQueryCriteria("t_localobtmind", primaryKey);
        // 设置读取最新版本
        criteria.setMaxVersions(1);
        criteria.addColumnsToGet("ddatetime");
        GetRowResponse getRowResponse = client.getRow(new GetRowRequest(criteria));
        Row row = getRowResponse.getRow();
        System.out.println("读取完毕，结果为：");
        System.out.println(row);
        Long endTime =System.currentTimeMillis();
        System.out.println("单行查询耗时:" + (endTime - startTime));
        client.shutdown();
        return "";
    }
    private static void getRange() {
        SyncClient client = new SyncClient(endPoint, accessKeyId,
                accessKeySecret, instanceName);
        Long startTime = System.currentTimeMillis();
        RangeRowQueryCriteria rangeRowQueryCriteria = new RangeRowQueryCriteria("t_localobtmind");
        // 设置起始主键
        PrimaryKeyBuilder primaryKeyBuilder = PrimaryKeyBuilder.
                createPrimaryKeyBuilder();
        primaryKeyBuilder.addPrimaryKeyColumn("ddatetime",
                PrimaryKeyValue.fromString("1997-01-02 00:00:00"));
        primaryKeyBuilder.addPrimaryKeyColumn("obtid",
                PrimaryKeyValue.fromString("G1150"));
        rangeRowQueryCriteria.setInclusiveStartPrimaryKey(
                primaryKeyBuilder.build());
        // 设置结束主键
        primaryKeyBuilder = PrimaryKeyBuilder.createPrimaryKeyBuilder();
        primaryKeyBuilder.addPrimaryKeyColumn("ddatetime",
                PrimaryKeyValue.fromString("1997-01-02 01:15:00"));
        primaryKeyBuilder.addPrimaryKeyColumn("obtid",
                PrimaryKeyValue.fromString("G1150"));
        rangeRowQueryCriteria.setExclusiveEndPrimaryKey(primaryKeyBuilder.build());
        rangeRowQueryCriteria.setMaxVersions(1);
        System.out.println("GetRange的结果为：");
        while (true) {
            GetRangeResponse getRangeResponse = client.getRange(
                    new GetRangeRequest(rangeRowQueryCriteria));
            for (Row row : getRangeResponse.getRows()) {
                System.out.println(row);
            }
            // 若nextStartPrimaryKey不为null, 则继续读取。
            if (getRangeResponse.getNextStartPrimaryKey() != null)
            {
                rangeRowQueryCriteria.setInclusiveStartPrimaryKey(
                        getRangeResponse.getNextStartPrimaryKey());
            } else {
                break;
            }
        }
        Long endTime =System.currentTimeMillis();
        System.out.println("范围查询耗时:" + (endTime - startTime));
        client.shutdown();
    }
    public static void main(String[] args) {
        getRange();
        getRow();
    }
}
*/
